﻿// ******************************************************************
// * Copyright(c)  Steven Lu
// * Description   : Entity_SALES_RETURN_ITEM
// * CreateDate    : 2013/1/28 13:04:25
// * Creater       : SalesReturnItemEntity
// * LastChangeDate: 2013/1/28 13:04:25
// * LastChanger   : 2013/1/28 13:04:25
// * Version Info  : 1.0 For ESOL
// ******************************************************************

using System;
using System.Data;
using System.Collections.Generic;
using System.Text;
using Suzsoft.Smart.EntityCore;
using ESOL.Common.Schema;

namespace ESOL.Common.Entity
{
    [Serializable]
    public partial class SalesReturnItemEntity : EntityBase
    {
        public SalesReturnItemTable TableSchema
        {
            get
            {
                return SalesReturnItemTable.Current;
            }
        }

        public SalesReturnItemEntity()
        {

        }

        public SalesReturnItemEntity(DataRow dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.SalesReturnOrderId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_RETURN_ORDER_ID"]));
            this.SalesProdPlanApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_PROD_PLAN_APPLICATION_ITEM_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["RETURN_QTY"]));
        }

        public SalesReturnItemEntity(DataRowView dr)
        {
            if (dr == null)
            {
                return;
            }
            this.Id = Convert.ToString(CommonFunctions.ToObject(dr["ID"]));
            this.SalesReturnOrderId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_RETURN_ORDER_ID"]));
            this.SalesProdPlanApplicationItemId = Convert.ToString(CommonFunctions.ToObject(dr["SALES_PROD_PLAN_APPLICATION_ITEM_ID"]));
            this.ProductId = Convert.ToString(CommonFunctions.ToObject(dr["PRODUCT_ID"]));
            this.ReturnQty = Convert.ToDecimal(CommonFunctions.ToObject(dr["RETURN_QTY"]));
        }

        public override TableInfo OringTableSchema
        {
            get
            {
                return SalesReturnItemTable.Current;
            }
        }

        #region Perporty List
        public string Id
        {
            get { return Convert.ToString(GetData(SalesReturnItemTable.C_ID)); }
            set { SetData(SalesReturnItemTable.C_ID, value); }
        }

        public string SalesReturnOrderId
        {
            get { return Convert.ToString(GetData(SalesReturnItemTable.C_SALES_RETURN_ORDER_ID)); }
            set { SetData(SalesReturnItemTable.C_SALES_RETURN_ORDER_ID, value); }
        }

        public string SalesProdPlanApplicationItemId
        {
            get { return Convert.ToString(GetData(SalesReturnItemTable.C_SALES_PROD_PLAN_APPLICATION_ITEM_ID)); }
            set { SetData(SalesReturnItemTable.C_SALES_PROD_PLAN_APPLICATION_ITEM_ID, value); }
        }

        public string ProductId
        {
            get { return Convert.ToString(GetData(SalesReturnItemTable.C_PRODUCT_ID)); }
            set { SetData(SalesReturnItemTable.C_PRODUCT_ID, value); }
        }

        public decimal ReturnQty
        {
            get { return Convert.ToDecimal(GetData(SalesReturnItemTable.C_RETURN_QTY)); }
            set { SetData(SalesReturnItemTable.C_RETURN_QTY, value); }
        }

        #endregion
    }


}

